[SPARK-20048][SQL] Cloning SessionState does not clone query execution listeners#17379
[SPARK-20048][SQL] Cloning SessionState does not clone query execution listeners#17379kunalkhamar wants to merge 4 commits intoapache:masterfrom
Conversation
|
Test build #75002 has finished for PR 17379 at commit
|
|
retest this please |
|
Test build #75015 has finished for PR 17379 at commit
|
|
Test build #75066 has finished for PR 17379 at commit
|
tdas
left a comment
There was a problem hiding this comment.
overall, i am confused as to why listener is not being passed as a constructor param, rather as a complicated override.
And why are docs being removed?
There was a problem hiding this comment.
These comments are adding little or no value. We should remove or make them more detailed, which would you prefer? If the latter, what's a good doc for shared state and experimental methods?
There was a problem hiding this comment.
Added it back, hopefully more descriptive.
There was a problem hiding this comment.
Each of these is identical to their SessionState counterpart and should be inherited by Scaladoc comment inheritance, do we still need them?
There was a problem hiding this comment.
HiveSessionState is gone, so this is not relevant anymore.
There was a problem hiding this comment.
Why do it this way? Why not pass it as a constructor param?
There was a problem hiding this comment.
I think the general rule we followed in the cloneSession PR is that vals that directly depend on SparkSession to be initialized, are to be constructor params. We leave the other vals in the body of class.
The advantage here is less duplicated code between SessionState, HiveSessionState and TestHiveSparkSession.
This is consistent with that, what would be the advantage of changing it to be a param?
There was a problem hiding this comment.
Builders were added in SPARK-20100. Changed initialization to use that pattern, so it is a constructor param now.
There was a problem hiding this comment.
Add a comment on what it creates? what the two things returned.
There was a problem hiding this comment.
super nit: cleaner to do
class CommandCollector extends QueryExecutionListener {
val commands = ...
...
}
|
Test build #75135 has finished for PR 17379 at commit
|
eb5581a to
16f5bea
Compare
|
Test build #75328 has finished for PR 17379 at commit
|
|
Test build #75331 has finished for PR 17379 at commit
|
tdas
left a comment
There was a problem hiding this comment.
Few minor comments.
@hvanhovell should take a look too.
| val conf: SQLConf, | ||
| val experimentalMethods: ExperimentalMethods, | ||
| val functionRegistry: FunctionRegistry, | ||
| val udf: UDFRegistration, |
| * | ||
| * Note 1: The user-defined functions must be deterministic. | ||
| * Note 2: This depends on the `functionRegistry` field. | ||
| */ |
There was a problem hiding this comment.
This file only contains effectively one builder. So it should be named after the class.
There was a problem hiding this comment.
It also contains a mix-in WithTestConf. But renaming is fine.
| * Builder that produces a Hive aware [[SessionState]]. | ||
| */ | ||
| @Experimental | ||
| @InterfaceStability.Unstable |
There was a problem hiding this comment.
This file should not be named HiveSessionState anymore. It doesnt even have the class HiveSessionState. It does have an object HiveSession, but do we need that object any more?
@hvanhovell
There was a problem hiding this comment.
Renamed, removed object HiveSessionState.
There was a problem hiding this comment.
Yeah, lets rename the file to HiveSessionBuilder.scala
|
Test build #75337 has finished for PR 17379 at commit
|
|
Test build #75338 has finished for PR 17379 at commit
|
|
cc @hvanhovell |
| * | ||
| * Note 1: The user-defined functions must be deterministic. | ||
| * Note 2: This depends on the `functionRegistry` field. | ||
| */ |
There was a problem hiding this comment.
Minor: I was wondering why you moved this into the builder?
There was a problem hiding this comment.
It was the only thing not initialized in the builder, thought it would be more consistent to have all initialization in the builder. Is this okay?
hvanhovell
left a comment
There was a problem hiding this comment.
@kunalkhamar could you rename HiveSessionState into HiveSessionStateBuilder? Other than that, LGTM.
|
@hvanhovell cool, it should be HiveSessionStateBuilder now. |
|
Merging to master. Thanks! |
What changes were proposed in this pull request?
Bugfix from SPARK-19540.
Cloning SessionState does not clone query execution listeners, so cloned session is unable to listen to events on queries.
How was this patch tested?